<?php
/**
 * 分类相关
 * Create by PhpStorm
 * User: lijia
 * Data: 2020/8/21
 * Time: 10:22
 */

namespace app\api\controller;


use app\api\business\CategoryBus;

class Category extends UserCommon
{

    public function __construct(){
        parent::__construct();
    }

    /**
     * 获取分类
     * @return \think\response\Json
     */
    public function getCategory(){
        $list = (new CategoryBus())->getCategorys();
        return resJson(200,'ok',$list);
    }



    public function getCategoryGoods(){
        $id = input('param.id',0,'intval');
        if (!$id) return resJson(0,'缺少参数');
        $list = (new CategoryBus())->getGoods($id);
        return resJson(200,'ok',$list);
    }

}